﻿@model IEnumerable<DynamicMenuDto>

<div class="navigation-box">
	<div class="navigation">
		<ul id="menu">
        @foreach (var item in Model)
        {
            <li class="@Html.ActiveMenuItemClassForUrl(item.Url)"><a href="@Url.Content(item.Url)">@item.Name<span>&nbsp;</span></a>
                @if (item.Children.Count > 0)
                {
                <ul class="submenu">
                    @foreach (var subitem in item.Children)
                    {
                    <li class="@Html.ActiveMenuItemClassForUrl(subitem.Url)">
                        <a href="@Url.Content(subitem.Url)">@subitem.Name</a>
                    </li>
                    }
                </ul>
                }
            </li>
        }

		@*	<li class="@Html.ActiveMenuItemClass("news", "blogs", "blogposts", "articles")"> <a href="@Url.Content("~/news/")">@Resources.EnetaMvc.News<span>&nbsp;</span></a>
				<ul class="submenu">
					<li><a href="@Url.Content("~/news/articles/")">@Resources.EnetaMvc.Articles</a></li>
					<li><a href="@Url.Content("~/news/blogs/posts/")">@Resources.EnetaMvc.Blogs</a></li>
				</ul>
			</li>*@
			@*<li> <a href="#">Õppimine</a>
				<ul class="submenu">
					<li><a href="#">Ajakirjad</a></li>
					<li><a href="#">Raamatud</a></li>
					<li><a href="#">Veebistuudium</a></li>
				</ul>
			</li>*@
			@*<li class="@Html.ActiveMenuItemClass("events")"> <a href="@Url.Content("~/events")">@Resources.EnetaMvc.Events</a>*@
				@*<ul class="submenu">
					<li><a href="#">Kalender</a></li>
					<li><a href="#">Fotod</a></li>
				</ul>*@
			@*</li>*@
			@*<li> <a href="#">Äri ja töö</a>
				<ul class="submenu">
					<li><a href="#">Firmad</a></li>
					<li><a href="#">Töökuulutused</a></li>
				</ul>
			</li>
			<li class="no-sub"><a href="#">Kommuun</a></li>*@
			@*<li class="@Html.ActiveMenuItemClass("forums")"> <a href="@Url.Content("~/forums/")">@Resources.EnetaMvc.Forum</a>*@
				@*<ul class="submenu">
					<li><a href="#">Tehnoloogia</a></li>
					<li><a href="#">Muud teemad</a></li>
					<li><a href="#">Mug.ee foorum</a></li>
				</ul>*@
			@*</li>*@
            @if (User.IsInRole("Administrator"))
            { 
                <li class="@Html.ActiveMenuItemClass("admin")"> <a href="@Url.Content("~/admin/")">Admin</a> </li>
            }
		</ul>
		<div class="search-holder">
			<form action="#">
				<fieldset>
				<input type="text" value="Otsi Eneta portaalist" class="clear" />
				<input class="search" type="image" src="@Url.Content("~/images/btn-search.gif")" />
				</fieldset>
			</form>
		</div>
	</div>
	<span class="navigation-right">&nbsp;</span>
</div>